kleaf: cut rules_cc -> protobuf dependency. This has caused too much trouble. Cutting the dependency makes it easier for Android kernel to handle its dependencies. Bug: 399691665 Change-Id: I712e68394e1ca6c6d91bd3759d2d1e8679445066 
diff --git a/MODULE.bazel b/MODULE.bazel index 123e24d..5c3383c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel 
@@ -7,7 +7,8 @@  bazel_dep(name = "bazel_features", version = "1.19.0")  bazel_dep(name = "bazel_skylib", version = "1.7.1")  bazel_dep(name = "platforms", version = "0.0.10") -bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf") +# ANDROID: Drop protobuf dependency to avoid being fetched from the Internet +# bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf")    cc_configure = use_extension("//cc:extensions.bzl", "cc_configure_extension")  use_repo(cc_configure, "local_config_cc", "local_config_cc_toolchains") 
diff --git a/cc/defs.bzl b/cc/defs.bzl index 4fccdcc..afcdba8 100644 --- a/cc/defs.bzl +++ b/cc/defs.bzl 
@@ -13,7 +13,6 @@  # limitations under the License.  """Starlark rules for building C++ projects."""   -load("@com_google_protobuf//bazel:cc_proto_library.bzl", _cc_proto_library = "cc_proto_library")  load("//cc:cc_binary.bzl", _cc_binary = "cc_binary")  load("//cc:cc_import.bzl", _cc_import = "cc_import")  load("//cc:cc_library.bzl", _cc_library = "cc_library") @@ -43,12 +42,11 @@  objc_library = _objc_library  objc_import = _objc_import   -# DEPRECATED: use rule from com_google_protobuf repository +# ANDROID: Drop protobuf dependency to avoid being fetched from the Internet  def cc_proto_library(**kwargs): - if "deprecation" not in kwargs: - _cc_proto_library(deprecation = "Use cc_proto_library from com_google_protobuf", **kwargs) - else: - _cc_proto_library(**kwargs) + fail("{}: Use cc_proto_library from com_google_protobuf".format( + native.package_relative_label(kwargs.get("name")), + ))    # Toolchain rules